<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>年龄案例</title>
    <script>
        var age=prompt('请输入你的年龄');
        alert('您的年龄是'+age+'岁！');
        console.log(typeof age);
        console.log(typeof parseInt(age));
        age.toString();
        console.log(typeof age);
        var xs='120.9px'
        console.log(parseInt(xs));//parseInt截取前面的数字，如果是小数，向下取整
        console.log(parseFloat('3.14'));
        console.log(parseFloat('3.14'));
        console.log(parseFloat('WW3.14PX'));
        console.log(Number('999'));
        console.log('99'-0);
        console.log('99'-'10');
        console.log(Number('9'/1));
        console.log(Number('999999'*1));
    </script>
</head>
<body>
    
</body>
</html>